home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
tex
/
meta27
/
mfpandor.lzh
/
number.mf
< prev
next >
Wrap
Text File
|
1990-11-16
|
18KB
|
469 lines
%*****************************************************************************
% Copyright (c) 1989 by N. N. Billawala
%*****************************************************************************
% number.mf numerals
% 10 characters
iff OK "0": "The number 0";
beginchar("0",num_width_c#+c_mono#,cap#,0);
if mono<>0:save circ; circ1=circ2=circ3=1.05; fi
top z1=(h_stress*w,h+ov_t.uc)//;
lft z2=(0,(1-v_stress)*h)//;
bot z3=((1-h_stress)*w,-ov_b.uc)//;
rt z4=(w,v_stress*h)//;
circular_shape(y1,y3,x2,x4,minor_curve.uc,bowlstem.uc);
showpoints(1,2,3,4);
adjust(.5num_fit_c#+m_a*c_mfit#,.5num_fit_c#+m_a*c_mfit#);
show_character; endchar;
iff OK "1": "The number 1";
beginchar("1",num_width_a#+b_mono#,cap#,0);
save_num(terminal_thickness)=max(.75thin_stem.uc,.3stem.uc);
bot z40=(.5w,0); multpos(1,4,40)(stem.uc,0);
lft x4l=round x40l; bot y4=0;
top z1=(x4,h)//;
onaline(1l,4l)(2l,3l); y3l=y3r=cap_bracket_h;
onaline(1r,4r)(2r,3r); y2r=y2l=max(h-cap_bracket_h,y3l);
y2l:=min(y2l,h-terminal_thickness-(stem.uc*sind max(25-.5oblique,0)));
p1=fullserif(z4,z1,z3l,z3r,1.25hs,1.25hs)--
terminalserif.l(z1,z4,z2l,z2r,1.5pt,max(25-.5oblique,0))--cycle;
showpoints(1,2,3,4);
adjust(.5num_fit_a#+m_a*b_mfit#,.5num_fit_a#+m_a*b_mfit#);
show_character; endchar;
def character_points=
iff OK "2": "The number 2";
beginchar(50+alt8,num_width_b#+b_mono#,cap#,0);
twotension:=10;
z1=(.05w,.9h)//;
rt z3r=(w,if inflection_two:.75h else:.7h fi)//;lft z3l=(z3r-(bowlstem.uc,0));
top y2r=bot y2l+max(1,major_curve.uc)=h+ov_t.uc;
good_x_for(2r)(z1,z3r,.5)a; good_x_for(2l)(z1+(bulb_thickness,0),z3l,.5)b;
top lft z5l=(0,max(1,.9stem.uc))//;
z4l=.5[z5l,z3l];
bot lft z6l=(0,0); z6r=z6l+(0,apex.uc)//;
bot rt z8=(.95w,0);
bot y7l=top y7r-max(1,.9stem.uc)=0;
good_x_for(7l)(z6l,z8,.5)c; good_x_for(7r)(z5r,z8-(tip_thickness,0),.5)d;
ref1=(z6r-(0,max(1,.8thin_stem.uc)))
..tension atleast twotension and 1..z3r{upward};
ref2=z3l{downward}..tension atleast 1 and twotension..z6r;
ref3=(-1,y7r)--(w,y7r);
ref4=z3l{downward}...z4l...z6r{downward}...z6l;
if inflection_two:
rt z5r=ref4 intersectionpoint ref3+(1.3thin_stem.uc,0); z4r=.5[z5r,z3r];
p1=(bulb.tl(z1,z2l,z2r,cs,bulb_thickness,90)soft i_t
ref4 if softpath:)softjoin(z6l fi
--arm.br(z8,z7r,z7l,.5as,.75tip_thickness,90-arm_angle+.5oblique)soft--
z5r if softpath:)softjoin(z5r fi
{upward}..z4r...z3r{upward} o_t z2r{left})--cycle;
else:
rt z5r=ref1 intersectionpoint ref3;
(t1,t2)=ref1 intersectiontimes ref3;
p1=(bulb.tl(z1,z2l,z2r,cs,bulb_thickness,90)soft i_t
ref2 soften(z6r,z6l)
arm.br(z8,z7r,z7l,.5as,.75tip_thickness,90-arm_angle+.5oblique)soft--z5r
if softpath:)softjoin(z5r fi
--subpath(t1,infinity)of ref1 o_t z2r{left})--cycle;
fi
showpoints(1,2,3,4,5,6,7,8);
adjust(.5num_fit_b#+m_a*b_mfit#,.5num_fit_b#+m_a*b_mfit#);
show_character; endchar;
enddef;
def number_two=save a,b;
vardef a=condition(inflection_two)t; testing_codes; character_points; enddef;
vardef b=condition(inflection_two)f; testing_codes; character_points; enddef;
if test_all_characters:a;b;else:if inflection_two:a;else:b;fi fi
enddef;
number_two; save number_two;
def three_diagonal_top(expr addtocode)=
iff OK "3": "The number 3";
beginchar(51+alt6+addtocode,num_width_b#+b_mono#,cap#,0);
top z1=(0w,h)//;
lft z9=(0,.05h)//;
bot lft z10r=(.05w,-ov_b.uc)//;
pos10(minor_curve.uc,-90-oblique);
z5=if open_tail:(.2w,.57h)//;else:(.3w,.55h)//; fi
z3r=(round(.97w),h-apex.uc)//;
z40=(.97w,h)//;
x5r=x5+.45thin_stem.uc*(cosd (90-oblique));
x5l=x5r-.9thin_stem.uc*(cosd (90-oblique));
top y2r=bot y2l+max(1,.9stem.uc)=h;
top y6r=top y5r=round(y5+.45thin_stem.uc);
bot y6l=bot y5l=y5r-max(1,.9thin_stem.uc);
bot y8r=top y8l-minor_curve.uc=-ov_b.uc;
z4l=z5r;
if open_tail:rt z7r=(w,.65[y8r,y6r])//;
lft z7l=(x7r-stem.uc,.65[y8l,y6l]);
else:rt z7r=(w,v_stress[y8r,y6r])//;
lft z7l=(x7r-stem.uc,v_stress[y8l,y6l]); fi
numeric theta[],phi[],d[];
d1=thin_stem.uc;
theta1=angle(length(z3r-z5r) +-+ d1,d1);
phi1=angle(z3r-z5r)-theta1;
multpos(3,4)(thin_stem.uc,phi1-90);
onaline(3l,4l)(41); y41=y2l;
onaline(3r,4r)(42); y42=y5r;
good_x_for(2r)(z1,z40,.4)a; good_x_for(2l)(z1+(bulb_thickness,0),z41,.4)b;
good_x_for(6r)(z42,z7r,.2)c; good_x_for(6l)(z5l,z7l,.3)d;
good_x_for(8r)(z9,z7r,.4)e; good_x_for(8l)(z9+(bulb_thickness,0),z7l,.4)f;
p1=(arm.tl(z1,z2l,z2r,.5as,.5tip_thickness,90)soft
soften(z41,z5r,z5l) z6l{right} i_t z7l{downward} i_t
if open_tail:{-(dir (7*h/w))}z10l--z10r{dir(7*h/w)}
else:bulb.bl(z9,z8l,z8r,.75cs,.75bulb_thickness,90) fi
o_t z7r{upward} o_t z6r{left} soften(z42,z3r,z40) z2r)--cycle;
showpoints(1,2,3,4,5,6,7,8,9,10,40,41,42);
adjust(.5num_fit_b#+m_a*b_mfit#,.5num_fit_b#+m_a*b_mfit#);
show_character; endchar;
enddef;
def three_round_top(expr addtocode)=
iff OK "3": "The number 3";
beginchar(51+alt6+addtocode,num_width_b#+b_mono#,cap#,0);
z1=(.05w,.95h)//;
lft z9=(0,.05h)//;
bot lft z10r=(.05w,-ov_b.uc)//;
pos10(minor_curve.uc,-90-oblique);
z5=(.3w,.55h)//;
x5r=x5+.45thin_stem.uc*(cosd (90-oblique));
x5l=x5r-.9thin_stem.uc*(cosd (90-oblique));
top y2r=bot y2l+minor_curve.uc=h+ov_t.uc;
top y4r=top y5r=round(y5+.45thin_stem.uc);
bot y4l=bot y5l=y5r-max(1,.9thin_stem.uc);
y6=.75[y5l,y5r];
bot y8r=top y8l-major_curve.uc=-ov_b.uc;
rt z3r=(round(.97w),v_stress[y6,y2r])//;
lft z3l=(x3r-stem.uc,v_stress[y5r,y2l]);
if open_tail:rt z7r=(w,.65[y8r,y6])//;
lft z7l=(x7r-stem.uc,.65[y8l,y4l]);
else:rt z7r=(w,v_stress[y8r,y6])//;
lft z7l=(x7r-stem.uc,v_stress[y8l,y4l]); fi
z3=.5[z3l,z3r];
good_x_for(2r)(z1,z3r,.5)a; good_x_for(2l)(z1+(bulb_thickness,0),z3l,.5)b;
good_x_for(4r)(z5r,z3l,.4)c; good_x_for(4l)(z5l,z7l,.4)d;
good_x_for(6)(z5,z3,.6)e;
good_x_for(8r)(z9,z7r,.4)g; good_x_for(8l)(z9+(bulb_thickness,0),z7l,.4)f;
p1=(bulb.tl(z1,z2l,z2r,1.2cs,.75bulb_thickness,90)soft i_t
z3l{downward} i_t z4r{left} soften(z5r,z5l) z4l{right} i_t z7l{downward}
i_t if open_tail:{-(dir (7*h/w))}z10l--z10r{dir(7*h/w)}
else:bulb.bl(z9,z8l,z8r,.75cs,.75bulb_thickness,90) fi
o_t z7r{upward} o_t
z6{left}--(z6+(0,epsilon){right} o_t z3r{upward} o_t z2r{left}))--cycle;
showpoints(1,2,3,4,5,6,7,8,9);
adjust(.5num_fit_b#+m_a*b_mfit#,.5num_fit_b#+m_a*b_mfit#);
show_character; endchar;
enddef;
vardef number_three=save first,second,third,fourth,addtocode;
addtocode:=-1;
vardef first=condition(diagonal_three)t; condition(open_tail)t;
testing_codes; three_diagonal_top(0); enddef;
vardef second=condition(diagonal_three)t; condition(open_tail)f;
testing_codes; three_diagonal_top(incr addtocode); enddef;
vardef third=condition(diagonal_three)f; condition(open_tail)t;
testing_codes; three_round_top(incr addtocode+alt7); enddef;
vardef fourth=condition(diagonal_three)f; condition(open_tail)f;
testing_codes; three_round_top(incr addtocode); enddef;
if test_all_characters:first;second;third;fourth;
elseif diagonal_three and open_tail:first;
elseif diagonal_three and (not open_tail):second;
elseif (not diagonal_three) and open_tail:third;
elseif (not diagonal_three) and (not open_tail):fourth; fi
enddef;
number_three; save number_three,three_diagonal_top,three_round_top;
iff OK "4": "The number 4";
beginchar(52+alt10,num_width_e#+.5*(d_mono#+e_mono#),cap#,0);
min_limit(join_radius)(.5minor_curve.uc);
top rt z11r=(round(.82w),h)//; multpos(11,13)(max(1,stem.uc),0);
rt z13r=(round(.82w),0);
bot lft z4l=(0,round(.2h))//; pos4(apex.uc,90-apex_angle);
onaline(11r,13r)(10r,12r,23,25);
onaline(11l,13l)(12l,20